package com.yl.pattern.structuralmodel.decorator;

/**
 * @Author 小羊
 * @Date 30/10/2024下午 9:20
 * @ClassName Client
 * @Description Client
 */
public class Client {
    public static void main(String[] args) {
        //点一份炒饭
        FastFood food = new FriendRice();
        System.out.println(food.getDesc()+" "+food.cost()+"元");

        //在炒饭中加一个鸡蛋
        food = new Egg(food);
        System.out.println(food.getDesc()+" "+food.cost()+"元");

        //在加一个培根
        food = new Bacon(food);
        System.out.println(food.getDesc()+" "+food.cost()+"元");
    }
}
